<?php ob_start();  session_start(); ?>

<html>
<body>
<script type="text/javascript">
var w = 0;
var h = 0;
if (window.innerWidth) {w = window.innerWidth; h = window.innerHeight;}
else if (document.all) {w = document.body.clientWidth; h = document.body.clientHeight;}
</script>
</body>
</html>
<?php



$myWidth = "<script>  
document.write(w); </script>";
$myHeight = "<script>  
document.write(h); </script>";
 // echo $myWidth." - ".$myHeight.'</br>' ;
      
 
include 'bloghoctap.net_Browser.php';
//echo $w;
$browser= new Browser();
//echo $browser->getBrowser();


function curPageName() {
 return $_SERVER["SCRIPT_NAME"];
}

//echo "The current page name is ".curPageName();


require_once "caching.php";
$cache = new SimpleCache();
$lang = $cache->get('lang');
if($lang=='')
	$lang='EN';




if($browser->getBrowser() == Browser::BROWSER_ANDROID){
	$_SESSION['browser'] = "ERP";
	$_SESSION['lang'] = $lang;
	//echo " chuyen trang php-phone";
	header('Location: ERP-Phone/login.php') ;
	//echo "<meta http-equiv='refresh' content='0; url=ERP-Phone/index.php' /> ";
}else{
	$_SESSION['browser'] = "ERP";
	$_SESSION['lang'] = $lang;
	//echo " chuyen trang php-pc";
	header('Location: ERP-PC/login.php') ;
	//echo "<meta http-equiv='refresh' content='0; url=ERP-PC/index.php' /> ";
}
/*if($browser->getBrowser() == Browser::BROWSER_FIREFOX)
     echo "This is firefox";
if($browser->getBrowser() == Browser::BROWSER_CHROME)
     echo "This is Chrome";
if($browser->getBrowser() == Browser::BROWSER_OPERA)
     echo "This is Opera";  
if($browser->getBrowser() == Browser::BROWSER_IE)
     echo "This is Internet Explore";  */
ob_flush();
?>
